package com.sam.cloud.admin.controller;

import com.sam.cloud.admin.feign.OrderFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @classname: HomeController
 * @description: TODO
 * @Author: sam
 * @date: 2021/8/8 18:12
 */
@Slf4j
@RestController
public class HomeController {

    @Value("${server.port}")
    private String port;

    @Value("${spring.application.name}")
    private String appName;

    @Autowired
    OrderFeignService orderFeignService;

    @GetMapping("info")
    public String info(){
        String msg = "I am from "+appName+" port:"+port;
        return msg;
    }

    @GetMapping("order/info")
    public String orderInfo(){
        return orderFeignService.info();
    }
}
